package oracle.apps.financials.collection.po;


import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cyrilmottier.android.greendroid.R;

public class ColorTextItemView extends RelativeLayout implements ItemView {

	private TextView mLeftTextView;
	private TextView mCenterTextView;
	private TextView mRightTextView;
	protected ImageView imageView;

	public ColorTextItemView(Context context) {
		this(context, null);
	}

	public ColorTextItemView(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	public ColorTextItemView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public void prepareItemView() {
		mLeftTextView = (TextView) findViewById(R.id.gd_color_text_left);
		mCenterTextView = (TextView) findViewById(R.id.gd_color_text_center);
		mRightTextView = (TextView) findViewById(R.id.gd_color_text_right);
		imageView = (ImageView) findViewById(R.id.row_arrow);
	}

	public void setObject(Item object) {
		ColorTextItem item = (ColorTextItem) object;
		mLeftTextView.setText(item.leftText);
		mCenterTextView.setText(item.centerText);
		if (item.centerTextColor != 0) {
			mCenterTextView.setTextColor(item.centerTextColor);
		}
		mRightTextView.setText(item.rightText);
		if (this.imageView != null) {
			if (!item.isShowDetailButton) {
				this.imageView.setVisibility(INVISIBLE);
			}
		}
	}

	public TextView getmLeftTextView() {
		return mLeftTextView;
	}

	public void setmLeftTextView(TextView mLeftTextView) {
		this.mLeftTextView = mLeftTextView;
	}

	public TextView getmCenterTextView() {
		return mCenterTextView;
	}

	public void setmCenterTextView(TextView mCenterTextView) {
		this.mCenterTextView = mCenterTextView;
	}

	public TextView getmRightTextView() {
		return mRightTextView;
	}

	public void setmRightTextView(TextView mRightTextView) {
		this.mRightTextView = mRightTextView;
	}
}
